package com.yxhl.zoume.data.http.rest.response.identification;

import com.yxhl.zoume.data.http.rest.response.base.BaseResponse;

/**
 * 项目名称：Ferrari
 * Created by menggod on 16/9/20 .
 */

public class IdentificationResponse extends BaseResponse {

    public String idCardNo;
    /**
     * isSucc:接口调用成功与否，不代表认证是否通过
     * authStatus：认证状态  (0:未认证  1:已通过   2:未通过   3:审核中)
     * auResultInfo：提示信息
     * realName：姓名
     * idCardNo：身份证号码
     */
    private String auResultInfo;
    private int authStatus;
    private String realName;

    public String getAuResultInfo() {
        return auResultInfo;
    }

    public int getAuthStatus() {
        return authStatus;
    }

    public String getRealName() {
        return realName;
    }

    public String getIdCardNo() {

        return getFilteredIdentifyNumber(idCardNo);
    }

    private String getFilteredIdentifyNumber(String IDNumber) {
        if (null != IDNumber) {
            StringBuilder sb = new StringBuilder();
            int length = IDNumber.length();
            if (length >= 8) {
                sb.append(IDNumber.substring(0, 4)).append("**********").append(IDNumber.substring(length - 4, length));
                return sb.toString();
            }
            return IDNumber;
        }
        return "";
    }
}
